<script setup>
import {reactive, ref} from "vue";

let parentMessage= ref('产品')
let items =reactive([
  {id:'item1',message:"可乐"},
  {id:'item2',message:"雪碧"}
])
</script>

<template>
  <div>
    <ul>
      <li v-for="item in items">{{item.message}}</li>
    </ul>
    <ul>
<!--   不一定非要用index，index只是索引，换成a也行   -->
      <li v-for="(item,index) in items">{{parentMessage}}-{{index+1}}-{{item.message}}</li>
    </ul>
  </div>
</template>

<style scoped>

</style>